package com.offcn.sellergood.feign;

import com.offcn.entity.Result;
import com.offcn.sellergood.pojo.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @Author: zola
 * @Date: 2021/9/11 - 09 - 11 - 22:17
 * @Description: com.offcn.sellergood.feign
 * @Version: 1.0
 */
@FeignClient(name = "SELLGOOD-SERVICE")
public interface ItemFeign {

    @PostMapping("/item/decr/count")
    public Result decr();

    @GetMapping("/item/status/{status}")
    public Result<List<Item>> findByStatus(@PathVariable("status") String status);

    // 远程调用sellergood-service中实现根据商品的id来获取商品的信息：接口加注解
    @GetMapping("/item/{id}")
    public Result<Item> findById(@PathVariable Long id);
}
